package org.wz.complex.work.kit.encrypt;


import java.util.Random;

public interface SaltKit {

    String TXT64 = """
                    /+abcdefg+ABCDEFG++//+hijklmn+HIJKLMN++//+opqrst+OPQRST++//+uvwxyz+UVWXYZ++/
                    /+abcdefg+ABCDEFG++//+hijklmn+HIJKLMN++//+opqrst+OPQRST++//+uvwxyz+UVWXYZ++/
                    /+abcdefg+ABCDEFG++//+hijklmn+HIJKLMN++//+opqrst+OPQRST++//+uvwxyz+UVWXYZ++/
                    """.trim().replaceAll("\r\n", "").replaceAll("\n", "");


    static String get(int len) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < len; i++) {
            Random r = new Random();
            int index = r.nextInt(TXT64.trim().length());
            sb.append(TXT64.trim().charAt(index));
        }
        return  sb.toString();

    }

    static String get4Len() {
        return get(4);
    }

    static String get8Len() {
        return get(8);
    }


    static String get8LenSimple() {
        return get(8)
                .replaceAll("=", "d")
                .replaceAll("\\+", "a")
                .replaceAll("/", "x");
    }



}
